package com.yumeko.service.impl;

import com.yumeko.entity.TAccount;
import com.yumeko.dao.TAccountDao;
import com.yumeko.service.TAccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * (TAccount)表服务实现类
 *
 * @author Zheng Hao
 * @since 2020-03-20 20:53:58
 */
@Service("tAccountService")
@Slf4j
public class TAccountServiceImpl implements TAccountService {
    @Resource
    private TAccountDao tAccountDao;


    @Override
    public void decrease(Long userId, BigDecimal money) {
        log.info("********->account-service中扣减账户余额开始");
/*        try {
            TimeUnit.SECONDS.sleep(20);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        tAccountDao.decrease(userId, money);
        log.info("********->account-service中扣减账户余额结束");
    }
}